#!/usr/bin/env python
# coding: utf-8

'''
Created on 2011-8-30

@author: zc
'''

import web
import os
#db = web.database(dbn='mysql', db='todo', user='root', pw='')

#web.config.debug = True
#session timeout seconds 
web.config.session_parameters['timeout'] = 86400

#logfile path
LOGFILENAME = '/var/log/tinyfeet.log'

# weibo callback url
_CALLBACK_URL = 'http://tinyfeet.us/callback'
#_CALLBACK_URL = 'http://0.0.0.0:8080/callback'
#_CALLBACK_URL = 'http://192.168.1.103:8080/callback' 

""" 每次load tfeet条数 """
NEXTFEET = 20

""" 紧要参数设置 """
CONSUME_KEY = "2878395190"
CONSUME_SECRET = "10aa081953af5cb5bc26b4839eb1cd02"
UPLOAD_DIRS = "static/tfeet/images/"

"""随机生成字符串长度设置"""
LENSTR = 8  

""" key失效时间 秒"""
EXPIRETIME = 86400

""" url 前缀"""
PRE_URL = "http://tinyfeet.us"



""" 浏览器端使用的一些常量 """
config = web.storage( 
    email = 'cn.popeye@gmail.com',
    site_name = 'tinyfeet',
    site_desc = '',
    static = '/static',
 )

""" 上传图片宽度限制 """
RULEWIDTH = 800

""" 图片缩放比例"""
PICRATE = 0.2

render = web.template.render( 'templates/', cache = False )
#render = web.template.render( '/data/www/tinyfeet/templates/', cache = False )

web.template.Template.globals['render'] = render

web.template.Template.globals['config'] = config

#queue keys
QUEUE_USER = 'user'
QUEUE_TFEET = 'tfeet'
QUEUE_NONE_COORDINATE = 'none_corrdinate'

#redis server 
REDIS_SRV_HOST = '127.0.0.1'
REDIS_SRV_PORT = 6379
#cron process number
PROCESS_NUM = 2
#process status check seconds
CHECK_SUBPROCESS_SECONDS = 15
